﻿Imports System

Imports Microsoft.VisualStudio.TestTools.UnitTesting

Imports FinRptWinForm



'''<summary>
'''This is a test class for Form1Test and is intended
'''to contain all Form1Test Unit Tests
'''</summary>
<TestClass()> _
Public Class Form1Test


    Private testContextInstance As TestContext

    '''<summary>
    '''Gets or sets the test context which provides
    '''information about and functionality for the current test run.
    '''</summary>
    Public Property TestContext() As TestContext
        Get
            Return testContextInstance
        End Get
        Set(ByVal value As TestContext)
            testContextInstance = Value
        End Set
    End Property

#Region "Additional test attributes"
    '
    'You can use the following additional attributes as you write your tests:
    '
    'Use ClassInitialize to run code before running the first test in the class
    '<ClassInitialize()>  _
    'Public Shared Sub MyClassInitialize(ByVal testContext As TestContext)
    'End Sub
    '
    'Use ClassCleanup to run code after all tests in a class have run
    '<ClassCleanup()>  _
    'Public Shared Sub MyClassCleanup()
    'End Sub
    '
    'Use TestInitialize to run code before running each test
    '<TestInitialize()>  _
    'Public Sub MyTestInitialize()
    'End Sub
    '
    'Use TestCleanup to run code after each test has run
    '<TestCleanup()>  _
    'Public Sub MyTestCleanup()
    'End Sub
    '
#End Region


    '''<summary>
    '''A test for btnGenerateReport_Click
    '''</summary>
    <TestMethod(), _
     DeploymentItem("FinRptWinForm.exe")> _
    Public Sub btnGenerateReport_ClickTest()
        Dim target As Form1_Accessor = New Form1_Accessor() ' TODO: Initialize to an appropriate value
        Dim sender As Object = Nothing ' TODO: Initialize to an appropriate value
        Dim e As EventArgs = Nothing ' TODO: Initialize to an appropriate value
        Dim fiscalPeriod As Integer = 10
        Dim fiscalYear As Integer = 2011
        Dim myDP As DataProcessor = New DataProcessor(fiscalYear, fiscalPeriod)
        target.btnGenerateReport_Click(sender, e)
        'Assert.Inconclusive("A method that does not return a value cannot be verified.")
        Assert.AreEqual(Of Integer)(fiscalPeriod, myDP.FiscalPeriod,
            "The fiscalPeriod was not correctly initialized.")
        Assert.AreEqual(Of Integer)(fiscalYear, myDP.FiscalYear,
            "The fiscalYear was not correctly initialized.")

    End Sub

    '''<summary>
    '''A test for Form1_Load
    '''</summary>
    <TestMethod(), _
     DeploymentItem("FinRptWinForm.exe")> _
    Public Sub Form1_LoadTest()
        Dim target As Form1_Accessor = New Form1_Accessor() ' TODO: Initialize to an appropriate value
        Dim sender As Object = Nothing ' TODO: Initialize to an appropriate value
        Dim e As EventArgs = Nothing ' TODO: Initialize to an appropriate value
        target.Form1_Load(sender, e)
        Assert.IsNotNull(target.cbFiscalPeriod.SelectedItem,
            "The fiscalPeriod was not correctly initialized.")
        Assert.IsNotNull(target.cbFiscalYear.SelectedItem,
            "The fiscalYear was not correctly initialized.")
    End Sub
End Class
